package com.hsh.vo.test;

/**
 * <p>
 *
 * </p>
 *
 * @author huangsihai
 * @date 9/14/2021 12:45 PM
 */
public class Threads {
    public static void main(String[] args) throws Exception {
        System.out.println("main start!!!");
        Thread thread1 = new Thread(() -> {
            System.out.println("thread1");
        });
        Thread thread2 = new Thread(() -> {
            System.out.println("thread2");
        });
        Thread thread3 = new Thread(() -> {
            System.out.println("thread3");
        });
        thread1.start();
        //实际上让主线程等待子线程执行完成
//        thread1.join();

        thread2.start();
//        thread2.join();

        thread3.start();
        thread3.join();

        System.out.println("main end!!!");
    }
}
